import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *

testCase = "dbshop016_商品管理管理分类前台侧边设置"
# 1.点击“删除”按钮，确定删除，删除成功。


firefox = openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu3(firefox,'商品管理','管理分类','前台侧边设置')

# 1.点击“删除”按钮，确定删除，删除成功。
firefox.find_element_by_xpath('//td[contains(.,"网站很好看")]/following-sibling::td[3]/a[2]').click()
firefox.switch_to.alert.accept()
time.sleep(2)

try:
    firefox.find_element_by_xpath('//td[contains(.,"网站很好看")]').is_displayed()
    writeLog("%s 测试失败" % testCase)
except:
    writeLog("%s 测试成功" % testCase)
    getPhoto(firefox)
firefox.quit()

